package com.hfb.mashibing.alip8.diamondsquarealgorithm.class08;

public class T01_Factorial {

    public static void main(String[] args) {
        int n = 6;
        while (n > 0) {
            System.out.println(n + "! = "+factorial(n));
            n--;
        }
    }

    private static int factorial(int n) {
        if (n==1)
            return 1;
        return n * factorial(n-1);
    }

}
